﻿using Microsoft.AspNetCore.Mvc;

namespace MvcLogin.Controllers
{
    public class TestController : Controller
    {
        public IActionResult Index()
        {
            string username = HttpContext.Session.GetString("username");
            if (!String.IsNullOrEmpty(username))
            {
                ViewData["Message"] = "欢迎" + username;
                return View();
            }

            return RedirectToAction("Index", "Login");
        }
    }
}
